.data
	
	a: .long 1		#Values
	
	b: .long 1
	
	c: .long 1
	
	d: .long 1
	
	e: .long 1
	
	f: .long 1
	
	g: .long 1
	
	h: .long 1
	
	i: .long 10
	
	j: .long 1

	

	str: .string "%d\n"	#Output String


.text

.globl main

main:
	

	movl i, %eax
	
	pushl %eax
	
	movl a, %eax
	
	addl b, %eax		# a + b
	
	pushl %eax
	
	movl g, %ebx
	
	addl c, %ebx		# g + c
	
	popl %eax
	
	imull %eax		# (a + b) * (g + c)
	
	movl %eax, %ebx
	
	popl %eax
	
	subl %ebx, %eax		# i - (a + b) * (g + c)
	
	pushl %eax


		
	movl h, %eax
	
	movl e, %ebx
	
	imull %ebx		# h * e
	
	pushl %eax
	
	movl f, %eax
	
	addl j, %eax		# f + j
	
	movl d, %ebx
	
	imull %ebx		# (f + j) * d
	
	movl %eax, %ebx
	
	popl %eax
	
	addl %ebx, %eax		# (h * e) + ((f + j) * d)
	
	movl %eax, %ebx
	
	popl %eax
	
	cltd
	
	idivl %ebx		# (i - (a + b) * (g + c)) / ((h * e) + ((f + j) * d))

	
	
	pushl %eax		# Push %eax into string
	
	pushl $str		# Push String
	
	call printf		# Print the String
	
	addl $8, %esp		# Fill Stackpointer
	
	
	
	movl $1, %eax		# Exit
	
	int $0x80		# Software Interrupt
